package com.ruoyi.agent.mapper;

import com.ruoyi.agent.domain.SysInterfacePrice;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author author
 * @since 2024-07-17
 */
public interface SysInterfacePriceMapper extends BaseMapper<SysInterfacePrice> {

    @Delete("delete from sys_interface_price where agent_id = #{agentId}")
    int deleteByAgentId(Long agentId);


   void insertSysInterfacePrice(SysInterfacePrice interfacePrice);

   @Select("select id,agent_id as agentId,identity_price as identityPrice, credit_price as creditPrice," +
           "negative_price as negativePrice,commercial_price as commercialPrice," +
           "education_price as educationPrice, degree_price as degreePrice," +
           "create_by as createBy,create_time as createTime,update_by as updateBy,update_time as updateTime from sys_interface_price where agent_id = #{agentId}")
    List<SysInterfacePrice> selectByAgentId(Long agentId);

    void updateByAgentId(SysInterfacePrice interfacePrice);
}
